<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:converters="clr-namespace:LockCrypt.Converters">

  <!-- SimpleStyles: ComboBox -->
  <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition Width="20" />
      </Grid.ColumnDefinitions>
      <Border
        x:Name="Border" 
        Grid.ColumnSpan="2"
        CornerRadius="1"
        Background="{StaticResource NormalBrush}"
        BorderBrush="{StaticResource SolidBorderBrush}"
        BorderThickness="1" />
      <Border 
        Grid.Column="0"
        CornerRadius="1,0,0,1" 
        Margin="1" 
        Background="{StaticResource WindowBackgroundBrush}" 
        BorderBrush="{StaticResource NormalBorderBrush}"
        BorderThickness="0,0,1,0" />
      <Path 
        x:Name="Arrow"
        Grid.Column="1"     
        Stroke="{StaticResource GlyphBrush}"
        StrokeThickness="2" 
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 1 1 L 4 4 7 1"/>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="ToggleButton.IsMouseOver" Value="true">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource DarkBrush}" />
      </Trigger>
      <Trigger Property="ToggleButton.IsChecked" Value="true">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
        <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
        <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
        <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
    <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" TextElement.Foreground="#000000" 
            MaxWidth="{Binding ActualWidth,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Grid}}}" />
  </ControlTemplate>
    
  <Style x:Key="{x:Type ComboBox}" TargetType="ComboBox">
    <Setter Property="Margin" Value="2" />
    <Setter Property="Padding" Value="2,0,2,0" />
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
    <Setter Property="MinWidth" Value="50"/>
    <Setter Property="MinHeight" Value="20"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ComboBox">
          <Grid>
            <ToggleButton 
              Name="ToggleButton" 
              Template="{StaticResource ComboBoxToggleButton}" 
              Grid.Column="2" 
              Focusable="false"
              IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
              ClickMode="Press">
            </ToggleButton>
            <ContentPresenter
              Name="ContentSite"
              IsHitTestVisible="False" 
              Content="{TemplateBinding SelectionBoxItem}"
              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
              Margin="3,1,23,1"
              VerticalAlignment="Center"
              HorizontalAlignment="Left" />
            <!--TextBox x:Name="PART_EditableTextBox"
              Template="{StaticResource ComboBoxTextBox}" 
              HorizontalAlignment="Left" 
              VerticalAlignment="Center" 
              Margin="3,3,23,3"
              Padding="{TemplateBinding Padding}"
              Focusable="True" 
              Background="Transparent"
              Visibility="Hidden"
              IsReadOnly="{TemplateBinding IsReadOnly}"/-->
              <TextBox HorizontalContentAlignment="{TemplateBinding Control.HorizontalContentAlignment}" 
                       VerticalContentAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
                       Margin="3,3,23,3"
                      Padding="0"
                      Focusable="True" 
                      Background="Transparent"
                      Visibility="Collapsed"
                      IsReadOnly="{TemplateBinding IsReadOnly}"
                       Name="PART_EditableTextBox" xml:space="preserve">
                <TextBox.Style>
                    <Style TargetType="TextBox">
                        <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="true"/>
                        <Setter Property="UIElement.AllowDrop" Value="True"/>
                        <Setter Property="FrameworkElement.MinWidth" Value="0"/>
                        <Setter Property="FrameworkElement.MinHeight" Value="0"/>
                        <Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}"/>
                        <Setter Property="Control.Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="TextBox">
                                    <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" MinHeight="0" Margin="0" Padding="0" Background="#00FFFFFF" Name="PART_ContentHost" 
                                                  Focusable="False" />
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </TextBox.Style>
            </TextBox>
            <Popup 
              Name="Popup"
              Placement="Bottom"
              IsOpen="{TemplateBinding IsDropDownOpen}"
              AllowsTransparency="True" 
              Focusable="False"
              PopupAnimation="Slide">
              <Grid 
                Name="DropDown"
                SnapsToDevicePixels="True"                
                MinWidth="{TemplateBinding ActualWidth}"
                MaxHeight="{TemplateBinding MaxDropDownHeight}">
                <Border 
                  x:Name="DropDownBorder"
                  Background="{StaticResource WindowBackgroundBrush}"
                  BorderThickness="1"
                  BorderBrush="{StaticResource SolidBorderBrush}"/>
                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                  <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
              </Grid>
            </Popup>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="HasItems" Value="false">
              <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
            <Trigger Property="IsGrouping" Value="true">
              <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </Trigger>
            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
              <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="2"/>
              <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
            </Trigger>
            <Trigger Property="IsEditable"
                 Value="true">
              <Setter Property="IsTabStop" Value="false"/>
              <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
              <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
    </Style.Triggers>
  </Style>

  <!-- SimpleStyles: ComboBoxItem -->
  <Style x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ComboBoxItem">
          <Border 
            Name="Border"
            Padding="1"
            SnapsToDevicePixels="true">
            <ContentPresenter />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsHighlighted" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
    
    <DataTemplate x:Key="LanguageListItem">
        <DataTemplate.Resources>
            <converters:CultureInfoToFlagConverter x:Key="CultureInfoToFlagConverter" />
        </DataTemplate.Resources>
        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Background="Transparent">
            <Image Source="{Binding Value,Converter={StaticResource CultureInfoToFlagConverter}}" Margin="0,0,6,0" Height="11" />
            <TextBlock Text="{Binding Value.EnglishName}" />
        </StackPanel>
    </DataTemplate>



    
    
    

    <!--Style TargetType="TextBox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:s="clr-namespace:System;assembly=mscorlib" 
           x:Key="autoCompleteTextBoxStyle">
        <Style.BasedOn>
            <Style TargetType="TextBoxBase">
                <Style.Resources>
                    <CollectionViewSource x:Key="viewSource" />
                </Style.Resources>
                <Setter Property="TextElement.Foreground">
                    <Setter.Value>
                        <DynamicResource ResourceKey="{x:Static SystemColors.ControlTextBrushKey}" />
                    </Setter.Value>
                </Setter>
                <Setter Property="Panel.Background">
                    <Setter.Value>
                        <DynamicResource ResourceKey="{x:Static SystemColors.WindowBrushKey}" />
                    </Setter.Value>
                </Setter>
                <Setter Property="Border.BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,20" MappingMode="Absolute">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FFABADB3" Offset="0.05" />
                                <GradientStop Color="#FFE2E3EA" Offset="0.07" />
                                <GradientStop Color="#FFE3E9EF" Offset="1" />
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Border.BorderThickness">
                    <Setter.Value>
                        <Thickness>1,1,1,1</Thickness>
                    </Setter.Value>
                </Setter>
                <Setter Property="Control.Padding">
                    <Setter.Value>
                        <Thickness>1,1,1,1</Thickness>
                    </Setter.Value>
                </Setter>
                <Setter Property="UIElement.AllowDrop">
                    <Setter.Value>
                        <s:Boolean>True</s:Boolean>
                    </Setter.Value>
                </Setter>
                <Setter Property="FrameworkElement.FocusVisualStyle">
                    <Setter.Value>
                        <x:Null />
                    </Setter.Value>
                </Setter>
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="TextBoxBase">
                            <StackPanel  >
                                <ListBox Background="{TemplateBinding Panel.Background}" BorderBrush="{TemplateBinding Border.BorderBrush}" BorderThickness="{TemplateBinding Border.BorderThickness}"  Name="Bd" SnapsToDevicePixels="True">
                                    <ScrollViewer Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
                                </ListBox>
                                <Popup x:Name="autoCompletePopup" 
                                       Placement="Bottom" 
                                       PlacementTarget="{Binding ElementName=Bd}"
                                       StaysOpen="False"
                                       AllowsTransparency="True">
                                    <ListBox x:Name="autoCompleteListBox"
                                             ItemsSource="{Binding Source={StaticResource viewSource}}" />
                                </Popup>
                            </StackPanel>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsEnabled">
                                    <Setter Property="Panel.Background" TargetName="Bd">
                                        <Setter.Value>
                                            <DynamicResource ResourceKey="{x:Static SystemColors.ControlBrushKey}" />
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="TextElement.Foreground">
                                        <Setter.Value>
                                            <DynamicResource ResourceKey="{x:Static SystemColors.GrayTextBrushKey}" />
                                        </Setter.Value>
                                    </Setter>
                                    <Trigger.Value>
                                        <s:Boolean>False</s:Boolean>
                                    </Trigger.Value>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Style.BasedOn>
        <Style.Resources>
            <ResourceDictionary />
        </Style.Resources>
    </Style>
    <Style TargetType="ComboBox" 
           xmlns:s="clr-namespace:System;assembly=mscorlib" 
           x:Key="autoCompleteComboBoxStyle">
        <Style.Resources>
            <CollectionViewSource x:Key="viewSource" />
        </Style.Resources>
        <Style.Triggers>
            <Trigger Property="ComboBox.IsEditable">
                <Setter Property="Border.BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,20" MappingMode="Absolute">
                            <LinearGradientBrush.GradientStops>
                                <GradientStop Color="#FFABADB3" Offset="0.05" />
                                <GradientStop Color="#FFE2E3EA" Offset="0.07" />
                                <GradientStop Color="#FFE3E9EF" Offset="1" />
                            </LinearGradientBrush.GradientStops>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Panel.Background">
                    <Setter.Value>
                        <DynamicResource ResourceKey="{x:Static SystemColors.WindowBrushKey}" />
                    </Setter.Value>
                </Setter>
                <Setter Property="KeyboardNavigation.IsTabStop">
                    <Setter.Value>
                        <s:Boolean>False</s:Boolean>
                    </Setter.Value>
                </Setter>
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ComboBox">
                            <Grid Name="Placement" SnapsToDevicePixels="True">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Popup IsOpen="False" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" AllowsTransparency="True" Name="PART_Popup" Grid.ColumnSpan="2">
                                        <Border BorderThickness="1,1,1,1" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" Name="DropDownBorder"
                                                MaxHeight="{TemplateBinding ComboBox.MaxDropDownHeight}">
                                            <ScrollViewer>
                                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" />
                                            </ScrollViewer>
                                        </Border>
                                </Popup>
                                <ListBox Background="{TemplateBinding Panel.Background}" BorderBrush="{TemplateBinding Border.BorderBrush}" BorderThickness="{TemplateBinding Border.BorderThickness}"  Name="Border" Grid.ColumnSpan="2" />
                                <TextBox IsReadOnly="False" HorizontalContentAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
                                         Name="PART_EditableTextBox" Margin="0,2,2,1" xml:space="preserve" Padding="5">
                                    <TextBox.Style>
                                        <Style TargetType="TextBox">
                                            <Setter Property="FrameworkElement.OverridesDefaultStyle">
                                                <Setter.Value><s:Boolean>True</s:Boolean></Setter.Value>
                                            </Setter>
                                            <Setter Property="UIElement.AllowDrop">
                                                <Setter.Value><s:Boolean>True</s:Boolean>
                                                </Setter.Value></Setter>
                                            <Setter Property="FrameworkElement.MinWidth">
                                                <Setter.Value><s:Double>0</s:Double></Setter.Value>
                                            </Setter><Setter Property="FrameworkElement.MinHeight">
                                                <Setter.Value><s:Double>0</s:Double></Setter.Value>
                                            </Setter><Setter Property="FrameworkElement.FocusVisualStyle">
                                                <Setter.Value><x:Null /></Setter.Value></Setter>
                                            <Setter Property="Control.Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="TextBox">
                                                        <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Background="#00FFFFFF" Name="PART_ContentHost" Focusable="False" Padding="5" Margin="5" />
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </TextBox.Style>
                                </TextBox>
                                <ToggleButton IsChecked="False" Grid.Column="1">
                                    <ToggleButton.Style>
                                        <Style TargetType="ToggleButton">
                                            <Style.Resources>
                                                <ResourceDictionary />
                                            </Style.Resources>
                                            <Setter Property="FrameworkElement.OverridesDefaultStyle">
                                                <Setter.Value>
                                                    <s:Boolean>True</s:Boolean>
                                                </Setter.Value>
                                            </Setter>
                                            <Setter Property="KeyboardNavigation.IsTabStop">
                                                <Setter.Value>
                                                    <s:Boolean>False</s:Boolean>
                                                </Setter.Value>
                                            </Setter>
                                            <Setter Property="UIElement.Focusable">
                                                <Setter.Value>
                                                    <s:Boolean>False</s:Boolean>
                                                </Setter.Value>
                                            </Setter>
                                            <Setter Property="Control.Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="ToggleButton">
                                                        <Button Background="{TemplateBinding Panel.Background}" BorderBrush="{TemplateBinding Border.BorderBrush}" Name="Chrome" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" SnapsToDevicePixels="True">
                                                            <Path Data="M0,0L3.5,4 7,0z" Fill="#FF000000" Name="Arrow" Margin="0,1,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                                        </Button>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="ToggleButton.IsChecked">
                                                                
                                                                <Trigger.Value>
                                                                    <s:Boolean>True</s:Boolean>
                                                                </Trigger.Value>
                                                            </Trigger>
                                                            <Trigger Property="UIElement.IsEnabled">
                                                                <Setter Property="Shape.Fill" TargetName="Arrow">
                                                                    <Setter.Value>
                                                                        <SolidColorBrush>#FFAFAFAF</SolidColorBrush>
                                                                    </Setter.Value>
                                                                </Setter>
                                                                <Trigger.Value>
                                                                    <s:Boolean>False</s:Boolean>
                                                                </Trigger.Value>
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </ToggleButton.Style>
                                </ToggleButton>
                                <Popup x:Name="autoCompletePopup" 
                                       Placement="Bottom" 
                                       PlacementTarget="{Binding ElementName=PART_EditableTextBox}"
                                       StaysOpen="False"
                                       AllowsTransparency="True">
                                    <ListBox x:Name="autoCompleteListBox"
                                             ItemsSource="{Binding Source={StaticResource viewSource}}" />
                                </Popup>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="UIElement.IsKeyboardFocusWithin">
                                    <Setter Property="TextElement.Foreground">
                                        <Setter.Value>
                                            <SolidColorBrush>#FF000000</SolidColorBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Trigger.Value>
                                        <s:Boolean>True</s:Boolean>
                                    </Trigger.Value>
                                </Trigger>
                                
                                <Trigger Property="ItemsControl.HasItems">
                                    <Setter Property="FrameworkElement.Height" TargetName="DropDownBorder">
                                        <Setter.Value>
                                            <s:Double>95</s:Double>
                                        </Setter.Value>
                                    </Setter>
                                    <Trigger.Value>
                                        <s:Boolean>False</s:Boolean>
                                    </Trigger.Value>
                                </Trigger>
                                <Trigger Property="UIElement.IsEnabled">
                                    <Setter Property="TextElement.Foreground">
                                        <Setter.Value>
                                            <DynamicResource ResourceKey="{x:Static SystemColors.GrayTextBrushKey}" />
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Panel.Background">
                                        <Setter.Value>
                                            <SolidColorBrush>#FFF4F4F4</SolidColorBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Trigger.Value>
                                        <s:Boolean>False</s:Boolean>
                                    </Trigger.Value>
                                </Trigger>
                                <Trigger Property="ItemsControl.IsGrouping">
                                    <Setter Property="ScrollViewer.CanContentScroll">
                                        <Setter.Value>
                                            <s:Boolean>False</s:Boolean>
                                        </Setter.Value>
                                    </Setter>
                                    <Trigger.Value>
                                        <s:Boolean>True</s:Boolean>
                                    </Trigger.Value>
                                </Trigger>
                                
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Trigger.Value>
                    <s:Boolean>True</s:Boolean>
                </Trigger.Value>
            </Trigger>
        </Style.Triggers>

        <Setter Property="FrameworkElement.FocusVisualStyle">
            <Setter.Value>
                <Style TargetType="IFrameworkInputElement">
                    <Style.Resources>
                        <ResourceDictionary />
                    </Style.Resources>
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle Stroke="#FF000000" StrokeThickness="1" StrokeDashArray="1 2" Margin="4,4,21,4" SnapsToDevicePixels="True" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="TextElement.Foreground">
            <Setter.Value>
                <DynamicResource ResourceKey="{x:Static SystemColors.WindowTextBrushKey}" />
            </Setter.Value>
        </Setter>
        <Setter Property="Panel.Background">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Color="#FFF3F3F3" Offset="0" />
                        <GradientStop Color="#FFEBEBEB" Offset="0.5" />
                        <GradientStop Color="#FFDDDDDD" Offset="0.5" />
                        <GradientStop Color="#FFCDCDCD" Offset="1" />
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Border.BorderBrush">
            <Setter.Value>
                <SolidColorBrush>#FF707070</SolidColorBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Border.BorderThickness">
            <Setter.Value>
                <Thickness>1,1,1,1</Thickness>
            </Setter.Value>
        </Setter>
        <Setter Property="Control.Padding">
            <Setter.Value>
                <Thickness>4,3,4,3</Thickness>
            </Setter.Value>
        </Setter>
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid Name="MainGrid" SnapsToDevicePixels="True">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
                        </Grid.ColumnDefinitions>
                        <Popup IsOpen="False" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" AllowsTransparency="True" Name="PART_Popup" Margin="1,1,1,1" Grid.ColumnSpan="2">
                                <Border BorderThickness="1,1,1,1" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" Name="DropDownBorder"
                                        MaxHeight="{TemplateBinding ComboBox.MaxDropDownHeight}">
                                    <ScrollViewer CanContentScroll="True">
                                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" />
                                    </ScrollViewer>
                                </Border>
                        </Popup>
                        <ToggleButton IsChecked="False" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}" Grid.ColumnSpan="2">
                            <ToggleButton.Style>
                                <Style TargetType="ToggleButton">
                                    <Style.Resources>
                                        <ResourceDictionary />
                                    </Style.Resources>
                                    <Setter Property="FrameworkElement.OverridesDefaultStyle">
                                        <Setter.Value>
                                            <s:Boolean>True</s:Boolean>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="KeyboardNavigation.IsTabStop">
                                        <Setter.Value>
                                            <s:Boolean>False</s:Boolean>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="UIElement.Focusable">
                                        <Setter.Value>
                                            <s:Boolean>False</s:Boolean>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Control.Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="ToggleButton">
                                                <Button Background="{TemplateBinding Panel.Background}" BorderBrush="{TemplateBinding Border.BorderBrush}" Name="Chrome" SnapsToDevicePixels="True">
                                                    <Grid Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" HorizontalAlignment="Right">
                                                        <Path Data="M0,0L3.5,4 7,0z" Fill="#FF000000" Name="Arrow" Margin="3,1,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                                    </Grid>
                                                </Button>
                                                <ControlTemplate.Triggers>
                                                    
                                                    <Trigger Property="UIElement.IsEnabled">
                                                        <Setter Property="Shape.Fill" TargetName="Arrow">
                                                            <Setter.Value>
                                                                <SolidColorBrush>#FFAFAFAF</SolidColorBrush>
                                                            </Setter.Value>
                                                        </Setter>
                                                        <Trigger.Value>
                                                            <s:Boolean>False</s:Boolean>
                                                        </Trigger.Value>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </ToggleButton.Style>
                        </ToggleButton>
                        <ContentPresenter Content="{TemplateBinding ComboBox.SelectionBoxItem}" ContentTemplate="{TemplateBinding ComboBox.SelectionBoxItemTemplate}" Margin="{TemplateBinding Control.Padding}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" IsHitTestVisible="False" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        
                        <Trigger Property="ItemsControl.HasItems">
                            <Setter Property="FrameworkElement.Height" TargetName="DropDownBorder">
                                <Setter.Value>
                                    <s:Double>95</s:Double>
                                </Setter.Value>
                            </Setter>
                            <Trigger.Value>
                                <s:Boolean>False</s:Boolean>
                            </Trigger.Value>
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled">
                            <Setter Property="TextElement.Foreground">
                                <Setter.Value>
                                    <DynamicResource ResourceKey="{x:Static SystemColors.GrayTextBrushKey}" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Panel.Background">
                                <Setter.Value>
                                    <SolidColorBrush>#FFF4F4F4</SolidColorBrush>
                                </Setter.Value>
                            </Setter>
                            <Trigger.Value>
                                <s:Boolean>False</s:Boolean>
                            </Trigger.Value>
                        </Trigger>
                        <Trigger Property="ItemsControl.IsGrouping">
                            <Setter Property="ScrollViewer.CanContentScroll">
                                <Setter.Value>
                                    <s:Boolean>False</s:Boolean>
                                </Setter.Value>
                            </Setter>
                            <Trigger.Value>
                                <s:Boolean>True</s:Boolean>
                            </Trigger.Value>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style-->


</ResourceDictionary>